<?php
    require_once $_site->get_handlepath('device');

	$id = request('id');
	$data['start_time']=$start_time=request('start_time');
	$data['end_time']=$end_time=request('end_time');
	$data['fbtime']=$fbtime=request('fbtime');
	$info=device_fun_get_record($id);

	require_once("header.php");

	require_once $_site->get_handlepath('admin');
	$xinfo=admin_fun_find_admin($info['xid']);

	require_once $_site->get_handlepath('device');
	//$bind = project_fun_bind($info['pid'], $info['did']);
	//$record = project_fun_group_record($info['pid'], $info['did'], $info['group'],$data);
    $val=$info;

?>

	<script type="text/javascript" charset="utf-8">
		loader.file({
			plugin:['validform/main','dialog/main','my97/wdatepicker'],
			skincss:['list']
		})

		function nouse(id){
		       if(!confirm('确认设置记录为无效 ？')){
		            return false;
		       }

		       $.getJSON('/handle.php',{id:id,h:'project/nouse'},function(res){
		           if(res.state){
		                 $("#no_"+id).remove();
		                 return false;
		           }
		           alert(res.msg);
		       });
		}
	</script>
	<style type="text/css">
		.table td a.hover{display: line-block;background: #60D277;color: #ffffff;padding:5px;}
		.goodimg{width:280px;background: #efefef none repeat scroll 0 0;border: 1px solid #aad381;}
		.table li{float:left;margin-right: 10px;margin-top: 10px;text-align: center;}
		.table img{margin:5px;}
		.table .text{text-align:left;margin-left:10px;}
		.table .operation{background:#aad381}
	</style>
</head>
<body>
	<div class="main">
      <form action="/handle.php" method="post" id="form1">
      <input type="hidden" name="h" value="device/edit">
      <input type="hidden" name="id" value="<?php echo $id?>">
		<table cellpadding="0" cellspacing="1" border="0" class="table">
		    <tr>
		       <td colspan="2">
		       <?php
		          $binds=project_fun_bind($info['pid'], $info['did']);
		       ?>
				   <p>
				                设备号：<strong><?php echo $info['dno']?></strong>&nbsp;&nbsp;
				                车牌号：<strong><?php echo $info['dname']?></strong>
				     <?php if($info['car_type']){ ?>
				     &nbsp;&nbsp;型号：<strong><?php echo $info['car_type']?></strong>
				     <?php }?>
				   </p>
				   <p>负责人：<?php echo $xinfo['name']?></p>
				   <p>产权人：<?php echo $info['downer']?>&nbsp;&nbsp;机车手：<?php echo $info['doper']?></p>
		       </td>
		    </tr>
		    <tr><td>

			     <li id="no_<?php echo $val['id'];?>">
                     <div class="goodimg">
					 <?php if($i<=10){ ?>
                     <img src="<?php $img=1==$val['delimg']?'/static/images/imgdel.jpg':$val['img'];echo $img ;?>" style="max-width: 260px;max-height:215px;">
					 <?php }else{ ?>
					 <img class="lazy" alt="" data-original="<?php $img=1==$val['delimg']?'/static/images/imgdel.jpg':$val['img'];echo $img ;?>" style="width: 260px;height:215px;">
					 <?php }?>
                     <p class="operation">
                                                                            登记时间：<?php echo date('Y-m-d H:i:s',$val['ctime'])?>&nbsp;&nbsp;&nbsp;&nbsp;
                         <?php if($cookie['group']!=12){?>
                         <a href="javascript:;" onclick="nouse(<?php echo $val['id'];?>);" title="点击设置记录无效">无效</a>
                         <?php }?>
                     </p>
                     </div>
                 </li>

			</td></tr>
		</table>
	</form>
	</div>
</body>
<script type="text/javascript" src="/static/js/jquery.lazyload.js"></script>
<script type="text/javascript">
$(function(){
    $("img.lazy").lazyload({effect:"fadeIn"});
});
</script>
</html>
